home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / telecomm / uniterm.zoo / example1.mac < prev    next >
Text File  |  1990-04-06  |  3KB  |  97 lines

  1. #####################################
  2. # Test Macro for UniTerm V2.0b 017  #
  3. # Copyright 1988 Simon Poole        #
  4. #                                   #
  5. #####################################
  6. # turn history recording on
  7. history(1)
  8. call(20)
  9. echo('\007\r\nSample UniTerm macro file')
  10. echo('\r\n-------------------------\007') 
  11. #
  12. # Reset the modem
  13. #
  14. copy(1,'ATZ')
  15. copy(2,'OK')
  16. set(2,5)
  17. call(4)
  18. #
  19. if(@1) echo('\r\nReset\r\n') jump(2)
  20. #
  21. echo('\r\nToo many retries\r\n') exit(-1)
  22. #
  23. # Dial the number and wait for CONNECT
  24. # (in real life you would use the dial() function)
  25. #
  26. :2
  27. # Get number from user
  28. if(!input('Enter number (012512002)')) echo('\r\nCancelled') exit(0)
  29. # if the string is empty use the default
  30. if(compare($T,'')) concat('012512002','')
  31. # Hayes want a ATD 
  32. concat('ATD',$T)
  33. # dial............
  34. copy(1,$T)
  35. copy(2,'CONNECT')
  36. set(2,30)
  37. call(4)
  38. if(!@1) echo('\r\nFailed\r\n')exit(1)
  39. #
  40. # Login
  41. #
  42. # this is for our LocalNet 20 system
  43. :6
  44. send('\r')
  45. if(!get('#',2)) break(100,FALSE) if(!get('#',2)) send('\001\001')
  46. send('echo off\r')
  47. if(!get('#',2)) echo('\r\nSomething is really wrong!') hangup() exit(-1)
  48. # call the system
  49. send('call e780\r')
  50. # should have a counter here, but you can always stop with ^C
  51. if(!get('COMPLETED',3)) send('done\r') jump(6)
  52. if(!get('ogin',3)) send('done\r') jump(6)
  53. send('poole\r')
  54. #
  55. # should send my password here
  56. #
  57. # Finished!
  58. exit(0)
  59. #########################################################
  60. #                                                       #
  61. #  Send a string to a Hayes compatible modem            #
  62. #                                                       #
  63. #########################################################
  64. #
  65. # @1 number of retries
  66. # @2 timeout
  67. # $1 string to send (telephone number...)
  68. # $2 string to wait for (CONNECT)
  69. #
  70. :4
  71. set(1,3)
  72. :5
  73.    echo('\r\nTry: ')
  74.    echo("add(4,-@1))
  75.    set(1,add(@1,-1))
  76.    wait(10)
  77. # send attn string
  78.    echo('\r\nSending +++')
  79.    send('+++')
  80. # we might get a OK here...
  81.    get('OK',2)
  82.    echo('\r\nSending ')
  83.    echo($1) 
  84.    send($1)
  85.    send('\r')
  86. if(and(!get($2,@2),@1)) jump(5)
  87. return()
  88. ########################################################
  89. #                                                      #
  90. # Home cursor and clear screen                         #
  91. #                                                      #
  92. ########################################################
  93. :20
  94. echo('\033[f\033[2J')
  95. return()
  96. ########################################################
  97.